# 导入数据
import pandas as pd
points=pd.read_excel('data/points/points.xlsx')
points.sort_values(by=['x','t'],inplace=True)
points.reset_index(drop=True,inplace=True)

# 求解
import random
X0=[random.randint(-5, 5) for _ in range(3)]
from src import solver as Solver
sol1=Solver.solve_2(*X0)
X0[1:3]=X0[2:0:-1]
sol2=Solver.solve_2(*X0)
cal1=Solver.calculate(sol1,points)
cal2=Solver.calculate(sol2,points)
X0=[-2,2,0,2,4]
sol3=Solver.solve_3(*X0)
X0=[-2,2,4,2,0]
sol4=Solver.solve_3(*X0)

# 绘图
from src import visualizer as vs
cal1.to_csv(f'data/result/result_{sol1.argv[1]}_{sol1.argv[2]}.csv')
cal2.to_csv(f'data/result/result_{sol2.argv[1]}_{sol2.argv[2]}.csv')
vs.show(sol1,cal1)
vs.show(sol2,cal2)
vs.show(sol3)
vs.show(sol4)